package com.jk.mapper;

import com.jk.vo.AuthRepInfo;
import com.jk.vo.WorkOrder;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * Created by ${user} on ${data}.
 */
public interface AuthRepInfoMapper {
    //法定代表人查询
//SELECT * FROM auth_rep_info t ,user_login l WHERE t.user_id=l.user_Id
    @Select("SELECT t.leg_place_info AS legPlaceInfo,t.leg_id AS legId," +
            "t.leg_idcard_number AS legIdcardNumber , t.leg_name AS legName," +
            "t.exam_status AS examStatus, t.agent_yn AS agentYn ,l.user_id AS userId,l.user_name AS userName   " +
            "FROM auth_rep_info t ,user_login l WHERE t.exam_status=1 AND t.user_id=l.user_Id")
    List<Map> SelectAuthRepInfo(AuthRepInfo authRepInfo);
    //法定代表身份修改
    @Update("update auth_rep_info  set exam_status=#{examStatus} where leg_id=#{legId}")
    int UpdateAuthRepInfo(AuthRepInfo authRepInfo);
    //工单表新增
    @Insert("insert into work_order(workOder_id,workOder_no,workOder_dic,workOder_time,wmployee_id,user_id,work_status)VALUES(#{workoderId},#{workoderNo},#{workoderDic},#{workoderTime},#{wmployeeId},#{userId},#{workStatus})")
    int InsertAuthRepInfo(WorkOrder workOrder);

}
